Skip to content

Conversation

@DarkGenius
Copy link
Collaborator

Fixes #472.

Summary

The Drawer component's root element was missing a z-index, causing it to appear behind elements with z-index: 1 when rendered in a Portal. This PR adds a default z-index of 1000 to the Drawer root container.

Changes

  • Added z-index: var(--gn-drawer-z-index, 1000) to Drawer root element in Drawer.scss
  • Updated README.md to document the new --gn-drawer-z-index CSS variable
  • The z-index is configurable via CSS variable for flexibility

Testing

  • ✅ TypeScript type checking passed
  • ✅ Linting passed (stylelint, eslint, prettier)
  • ✅ No existing tests affected (jest passes)

This fix ensures the Drawer component properly appears above other page elements, similar to how Modal components behave.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

The Drawer component's root element was missing a z-index, causing it
to appear behind elements with even a z-index of 1. This fix adds
z-index support to the Drawer root container via the --gn-drawer-z-index
CSS variable.

Changes:
- Added z-index: var(--gn-drawer-z-index) to Drawer root element
- Updated README to document the new --gn-drawer-z-index CSS variable
- No default value provided to avoid breaking existing layouts
- Users can set the CSS variable to control stacking order (e.g., 1000)
@DarkGenius DarkGenius merged commit 9fab3f9 into main Oct 9, 2025
5 checks passed
@DarkGenius DarkGenius deleted the fix/issue-472 branch October 9, 2025 12:18
kkirik pushed a commit that referenced this pull request Nov 4, 2025
The Drawer component's root element was missing a z-index, causing it
to appear behind elements with even a z-index of 1. This fix adds
z-index support to the Drawer root container via the --gn-drawer-z-index
CSS variable.

Changes:
- Added z-index: var(--gn-drawer-z-index) to Drawer root element
- Updated README to document the new --gn-drawer-z-index CSS variable
- No default value provided to avoid breaking existing layouts
- Users can set the CSS variable to control stacking order (e.g., 1000)
DarkGenius added a commit that referenced this pull request Nov 26, 2025
The Drawer component's root element was missing a z-index, causing it
to appear behind elements with even a z-index of 1. This fix adds
z-index support to the Drawer root container via the --gn-drawer-z-index
CSS variable.

Changes:
- Added z-index: var(--gn-drawer-z-index) to Drawer root element
- Updated README to document the new --gn-drawer-z-index CSS variable
- No default value provided to avoid breaking existing layouts
- Users can set the CSS variable to control stacking order (e.g., 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawer component root element missing z-index, causing stacking context issues

4 participants